<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

// 不需要权限的api
Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
], function(Router $router){
    $router->any('mail/api-send', 'MailController@anyApiSend');
});

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {
    
    $router->get('/', 'HomeController@index');
    $router->any('home/redirect', 'HomeController@redirect');
    $router->any('home/test', 'HomeController@test');
    $router->any('home/test-upload-file', 'HomeController@testUploadFile');
    $router->any('home/test-upload', 'HomeController@testUpload');

    $router->any('player/list-account', 'PlayerController@anyListAccount');
    $router->any('player/show', 'PlayerController@anyShow');
    $router->any('player/ajaxActPlayer', 'PlayerController@ajaxActPlayer');
    $router->any('player/list-power', 'PlayerController@anyListPower');
    $router->any('player/add-power', 'PlayerController@anyAddPower');
    $router->any('player/api-power', 'PlayerController@apiPower');
    $router->any('player/test-online', 'PlayerController@testOnlinePlayer');
    $router->any('player/fetchData', 'PlayerController@fetchData');
    $router->any('player/view', 'PlayerController@view');
    $router->any('player/disable-chat', 'PlayerController@anyDisableChat');
    $router->any('player/api-disable-chat', 'PlayerController@apiDisableChat');
    $router->any('player/api-role-seal', 'PlayerController@apiRoleSeal');
    $router->any('player/behavior', 'PlayerController@anyPlayerBehavior');
    $router->any('player/promote-gm', 'PlayerController@anyPromoteGm');
    $router->any('player/role-list', 'PlayerController@anyRoleList');
    $router->any('player/clear-rank', 'PlayerController@apiClearRank');
    $router->any('player/delete-account', 'PlayerController@apiDeleteAccount');
    $router->any('player/enclose-account', 'PlayerController@apiEncloseDevice');


    $router->any('userst/area', 'UserstController@anyArea');
    $router->any('userst/remain', 'UserstController@anyRemain');
    $router->any('userst/remain-week', 'UserstController@anyRemainWeek');
    $router->any('userst/remain-account', 'UserstController@anyRemainAccount');
    $router->any('userst/api-remain', 'UserstController@anyApiRemain');
    $router->any('userst/duration-deinc', 'UserstController@anyDurationDeinc');
    $router->any('userst/increase-day', 'UserstController@anyIncreaseDay');
    $router->any('userst/levels-num', 'UserstController@anyNumberOfLevels');
    $router->any('userst/retain-delete-area', 'UserstController@anyApiRetainDeleteRole');

    // 玩家登陆统计
    $router->any('loginst/login-time', 'LoginstController@loginTime');
    $router->any('loginst/conv-rate', 'LoginstController@userConvRate');

    // 游戏数据库管理
    $router->any('game-db-conf', 'GameDbConfController@index');
    $router->any('game-db-conf/list-db', 'GameDbConfController@anyListDb');
    $router->any('game-db-conf/create', 'GameDbConfController@anyCreate');
    $router->any('game-db-conf/edit', 'GameDbConfController@anyEdit');
    $router->any('game-db-conf/api-save', 'GameDbConfController@anyApiSave');
    // 获取map服务列表
    $router->any('game-db-conf/map-list', 'GameDbConfController@anyMapList');
    $router->any('game-db-conf/map-edit', 'GameDbConfController@anyMapEdit');
    // server area list
    $router->any('area', 'AreaController@index');
    $router->any('area/edit', 'AreaController@anyEdit');
    $router->any('area/create', 'AreaController@anyAdd');
    $router->any('area/show', 'AreaController@anyShow'); 
    $router->any('area/api-server', 'AreaController@apiServerRestart'); // apiServerRestart
    $router->any('area/api-save', 'AreaController@anyApiSave');
    $router->any('area/api-delete', 'AreaController@anyApiDelete');
    $router->any('area/edit-extend', 'AreaController@anyEditExtend');
    $router->any('area/api-extend-save', 'AreaController@anyApiExtendSave');
    $router->any('area/login-white', 'AreaController@anyLoginWhite');
    $router->any('area/edit-login-white', 'AreaController@anyEditLoginWhite');
    $router->any('area/api-login-white-save', 'AreaController@anySaveLoginWhite');

    $router->any('area/state-list', 'AreaController@anyAreaStateList');
    $router->any('area/edit-state', 'AreaController@anyEditState');
    $router->any('area/api-state-save', 'AreaController@anySaveState');
    $router->any('area/api-state-delete', 'AreaController@anyApiStateDelete');
    $router->any('area/api-state-clone', 'AreaController@anyCloneState');

    $router->any('mail', 'MailController@index');
    $router->any('mail/edit', 'MailController@anyEdit');
    $router->any('mail/create', 'MailController@anyAdd');
    $router->any('mail/api-save', 'MailController@anyApiSave');
    $router->any('mail/item-all', 'MailController@anyItemAll');

    $router->any('notice', 'NoticeController@index');
    $router->any('notice/edit', 'NoticeController@anyEdit');
    $router->any('notice/create', 'NoticeController@anyAdd');
    $router->any('notice/api-save', 'NoticeController@anyApiSave');
    $router->any('notice/api-send', 'NoticeController@anyApiSend');

    $router->any('notice-interval', 'NoticeIntervalController@index');
    $router->any('notice-interval/edit', 'NoticeIntervalController@anyEdit');
    $router->any('notice-interval/create', 'NoticeIntervalController@anyAdd');
    $router->any('notice-interval/api-save', 'NoticeIntervalController@anyApiSave');
    $router->any('notice-interval/api-send', 'NoticeIntervalController@anyApiSend');

    $router->any('notice-plat', 'NoticePlatController@index');
    $router->any('notice-plat/create', 'NoticePlatController@anyAdd');
    $router->any('notice-plat/delete', 'NoticePlatController@delete');
    $router->any('notice-plat/edit', 'NoticePlatController@anyEdit');
    $router->any('notice-plat/api-save', 'NoticePlatController@anyApiSave');

    $router->any('cdkey', 'CdkeyController@index');
    $router->any('cdkey/edit', 'CdkeyController@anyEdit');
    $router->any('cdkey/create', 'CdkeyController@anyAdd');
    $router->any('cdkey/api-save', 'CdkeyController@anyApiSave');
    $router->any('cdkey/code', 'CdkeyController@anyCode');
    $router->any('cdkey/generate', 'CdkeyController@anyGenerate');

    $router->any('command', 'CommandController@index');
    $router->any('command/area', 'CommandController@anyArea');
    $router->any('command/edit', 'CommandController@anyEdit');
    $router->any('command/create', 'CommandController@anyAdd');
    $router->any('command/api-save', 'CommandController@anyApiSave');
    $router->any('command/api-send', 'CommandController@anyApiSend');
    $router->any('command/command', 'CommandController@anyCommand');
    $router->any('command/reload-config-list', 'CommandController@anyReloadConfigList');
    $router->any('command/reload-config', 'CommandController@reloadConfCommand');
    $router->any('command/open-gm-command', 'CommandController@anyOpenGmCommand');

    // 付费统计
    $router->any('payst/rate', 'PaystController@anyRate');
    $router->any('payst/area-rate', 'PaystController@anyAreaRate');
    $router->any('payst/recharge', 'PaystController@anyRecharge');
    $router->any('payst/recharge-json', 'PaystController@anyRechargeJson');
    $router->any('payst/recharge-role', 'PaystController@anyChargeByRole');
    $router->any('payst/gen-charge-retain-role', 'PaystController@genChargeRetainRole');
    $router->any('payst/recharge/{id}', 'PaystController@anyRechargeSave');

    //订单列表
    $router->any('orderform/list-all', 'OrderFormController@anyListAccount');
    $router->any('orderform/show', 'OrderFormController@anyShow');
    $router->any('orderform/api-save', 'OrderFormController@anyApiSave');
    $router->any('orderform/edit', 'OrderFormController@anyEdit');
    $router->any('orderform/item-all', 'OrderFormController@anyItemAll');
    $router->any('orderform/show', 'OrderFormController@anyShow');

    //根据玩家ID统计消费信息列表
    $router->any('playerform/list-all', 'PlayerFormController@anyListAccount');
    $router->any('playerform/show', 'PlayerFormController@anyShow');
    //根据玩家某个ID订单列表
    $router->any('playerorder/list-all', 'PlayerOrderController@anyListAccount');

    //根据服务器统计消费信息列表
    $router->any('areaform/list-all', 'AreaFormController@anyListAccount');
    $router->any('areaform/show', 'AreaFormController@anyShow');
    $router->any('areaform/list-deal', 'AreaFormController@anyListDeal');
    $router->any('areaform/area-form-player-group', 'AreaFormController@anyAreaOrderPlayerGroup');
    $router->any('areaform/area-form-product', 'AreaFormController@anyAreaFormProduct');
    //根据某个服务器订单列表
    $router->any('areaorder/list-all', 'AreaOrderController@anyListAccount');
    $router->any('areaorder/detail', 'AreaOrderController@anyOrderDetail');
    $router->any('areaorder/repair', 'AreaOrderController@anyRepairOrder');
    $router->any('areaorder/delete-soft', 'AreaOrderController@anyDeleteOrder');
    $router->any('areaorder/list-deleted', 'AreaOrderController@anyListAccountDeleted');
    $router->any('areaorder/ticket-total', 'AreaOrderController@anyTicketTotal');


    //活动配置项
    $router->any('activity/event-list', 'ActivityController@anyEventList');
    $router->any('activity/list', 'ActivityController@index');
    $router->any('activity/create', 'ActivityController@anyAdd');
    $router->any('activity/edit', 'ActivityController@anyEdit');
    $router->any('activity/api-save', 'ActivityController@anyApiSave');
    $router->any('activity/show', 'ActivityController@anyShow');
    $router->any('activity/api-delete', 'ActivityController@anyApiDelete');
    $router->any('activity/sync-game', 'ActivityController@anySyncToGame');

    $router->any('retain-account/st-account-temp', 'RetainAccountController@anyStAccountTemp');

    $router->any('retain-player/retain-player-hour', 'RetainPlayerController@anyRetainPlayerHour');
    $router->any('retain-player/retain-player-hour-clear', 'RetainPlayerController@anyRetainPlayerHourClear');

    // 临时返利
    $router->any('acitivity-temp/diamond-rebate-list', 'ActivityTempController@anyGetDiamondRebateList');
    $router->any('acitivity-temp/diamond-rebate-generate', 'ActivityTempController@anyDiamondRebateGenerate');
    $router->any('acitivity-temp/diamond-rebate-reward', 'ActivityTempController@anyDiamondRebateReward');

    // 版本管理器
    $router->any('version/manager-list', 'VersionController@anyManagerCdnList');
    $router->any('version/manager-edit', 'VersionController@anyManagerEdit');
    $router->any('version/api-manager-save', 'VersionController@anyApiManagerUpgrade');
    $router->any('version/label-list', 'VersionController@anyLabelList');
    $router->any('version/label-save', 'VersionController@anyLabelSave');

    // 行为日志
    $router->any('behavior/group-behavior', 'BehaviorController@anyGroupBehavior');
    $router->any('behavior/behavior-coin', 'BehaviorController@anyBehaviorCoin');
    $router->any('behavior/thew-count', 'BehaviorController@anyThewCount');
    $router->any('behavior/cost-count', 'BehaviorController@anyCostCount');
    $router->any('behavior/pannel', 'BehaviorController@anyBehaviorPannel');//anyBehaviorPannel
    

    //
    $router->any('command/chat-gm', 'CommandController@anyChatGM');
    $router->any('command/sync-players', 'CommandController@anySyncPlayerRoles');
    
});
